package o;

import com.huawei.appgallery.downloadengine.api.SessionDownloadTask;
import com.huawei.appgallery.foundation.account.bean.UserSession;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import com.tencent.mm.opensdk.modelmsg.WXMediaMessage;
import o.dge.d;
import o.ewm.n;

public class dvk extends cvs {
    public static final String APIMETHOD = "client.downloadResultRep";
    public static final int DOWNLOAD_FAIL = -1;
    public static final int DOWNLOAD_SUCCESS = 0;
    private static final String TAG = "DownloadResultRequest";
    private String aId_;
    private String accessId_ = null;
    private String advInfo;
    private String advPlatform = null;
    private String appId_;
    private int appType_ = 1;
    private String channelNo_;
    private String detailId_;
    private int dlType_ = 0;
    private int downResult_ = 0;
    private String downloadDetail_;
    private String expand_;
    private String familyShare_;
    private int maple_;
    private String pkgName_;
    private String reason_;
    private String referrer;
    private int renew_ = 0;
    private String tId_;
    private String trace_;
    private int versionCode_;

    public dvk(SessionDownloadTask sessionDownloadTask, int i) {
        Logger.ˎ(TAG, "task.getDlType_() = " + String.valueOf(sessionDownloadTask.ˌ()) + ", task.getUrl_() = " + sessionDownloadTask.ᐝ() + ", task.getPackageName_() = " + sessionDownloadTask.ˊˊ() + ", downResult = " + String.valueOf(i));
        setStoreApi("clientApi");
        setMethod_(APIMETHOD);
        this.appId_ = sessionDownloadTask.ॱˋ();
        this.pkgName_ = sessionDownloadTask.ˊˊ();
        this.downResult_ = i;
        this.detailId_ = sessionDownloadTask.ॱˊ();
        this.tId_ = String.valueOf(sessionDownloadTask.ʾ());
        this.accessId_ = sessionDownloadTask.ॱͺ();
        this.trace_ = sessionDownloadTask.ˋᐝ();
        this.aId_ = cej.ˊ(sessionDownloadTask.ᐝ(), "aId");
        this.dlType_ = sessionDownloadTask.ˌ();
        this.versionCode_ = sessionDownloadTask.ॱᐝ();
        setServiceType_(sessionDownloadTask.ॱ());
        this.appType_ = sessionDownloadTask.ॱॱ();
        this.channelNo_ = dof.ˏ(sessionDownloadTask.ᐝ(), "channelNo");
        if (i == -1) {
            this.reason_ = sessionDownloadTask.ˏॱ().toString();
            dgh.onEvent(new d(ContentManager.getInstant().getContext(), n.ᐨ).ˏ(sessionDownloadTask.ॱˋ() + HiAnalyticsConstant.REPORT_VAL_SEPARATOR + sessionDownloadTask.ˏॱ().ˋ).ˋ());
        }
        this.maple_ = sessionDownloadTask.ˋ();
        o.cvu.RequestStrategy ͺ = sessionDownloadTask.ͺ();
        StringBuilder stringBuilder = new StringBuilder(WXMediaMessage.DESCRIPTION_LENGTH_LIMIT);
        stringBuilder.append(String.valueOf(ͺ.ˏ())).append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR).append(String.valueOf(ͺ.ˎ())).append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR).append(String.valueOf(sessionDownloadTask.ˊˋ())).append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR).append(String.valueOf(ͺ.ॱ() ? 1 : 0)).append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR).append(ͺ.ˋ()).append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR);
        String ˏ = dof.ˏ(sessionDownloadTask.ᐝ(), "source");
        if (ˏ != null) {
            stringBuilder.append(ˏ);
        }
        ˏ = dof.ˏ(sessionDownloadTask.ᐝ(), "subsource");
        if (ˏ != null) {
            stringBuilder.append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR).append(ˏ);
        }
        if (stringBuilder.length() > WXMediaMessage.DESCRIPTION_LENGTH_LIMIT) {
            this.expand_ = stringBuilder.substring(0, WXMediaMessage.DESCRIPTION_LENGTH_LIMIT);
        } else {
            this.expand_ = stringBuilder.toString();
        }
        UserSession instance = UserSession.getInstance();
        if (!(instance == null || instance.getServiceToken() == null)) {
            ॱ(epk.ˏ());
        }
        if (!sessionDownloadTask.ꜟ()) {
            this.downloadDetail_ = sessionDownloadTask.ॱʽ();
        }
        if (sessionDownloadTask.ˌ() == 4) {
            setBlockIfProtocolNotAgreed(false);
        }
        this.familyShare_ = sessionDownloadTask.ॱˎ("familyShare");
        if (dug.ॱ(sessionDownloadTask.ˊˊ()) != null) {
            this.renew_ = 1;
        }
        this.advPlatform = sessionDownloadTask.ॱˎ("advPlatform");
        if (String.valueOf(1).equals(this.advPlatform)) {
            this.advInfo = sessionDownloadTask.ॱˎ("advInfo");
            this.referrer = sessionDownloadTask.ॱˎ("referrer");
        }
    }

    public String ˎ() {
        return this.advInfo;
    }

    public String ˊ() {
        return this.referrer;
    }

    public String ˋ() {
        return this.advPlatform;
    }

    public String ॱ() {
        return this.pkgName_;
    }
}
